#pragma once

#include <gtl/ui/skins/pane.h>

namespace gtl
{

namespace skins
{

class bitmap_info
{
public:
	bitmap_info(CBitmap& bmp) : m_bmp(bmp)
	{
		m_bmp.GetBitmap(&m_bmp_info);
	}

	int Width()		{ return m_bmp_info.bmWidth;  }
	int Height()	{ return m_bmp_info.bmHeight; }
	BITMAP& info()	{ return m_bmp_info; }

private:
	bitmap& m_bmp;
	BITMAP	 m_bmp_info;
};

class image
	: public wnd
	, public control<image, 'img'>
{
	auto_reg_to_the_factory();

public:
	image();
	virtual ~image();

public:
	virtual unsigned int initialize(gtl::xml& node, wnd* parent_wnd);

protected:
	DECLARE_MESSAGE_MAP()
	afx_msg BOOL OnEraseBkgnd(CDC* pDC);
	afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
	afx_msg void OnLButtonUp(UINT nFlags, CPoint point);

protected:
	bitmap*	  m_img;
	int		  m_width;
	int		  m_height;
	int		  m_adapt;
	HCURSOR	  m_hand;
	gtl::tstr m_action;
	gtl::tstr m_hypelink;
};

} // end of namespace skins

} // end of namespace gtl